package com.geeguo.ebuilder.client.base.core.dictionary;

import com.geeguo.ebuilder.core.common.dictionary.IDictionary;

import java.util.Arrays;
import java.util.List;

public enum ExcelImportStatusEnum implements IDictionary {

    Created(1, "已创建"),
    Pending(2, "排队中"),
    Processing(3, "进行中"),
    Error(4, "错误"),
    Finished(5, "完成");

    private int    value;
    private String label;

    ExcelImportStatusEnum(int value, String label) {
        this.value = value;
        this.label = label;
    }

    @Override
    public int getValue() {
        return value;
    }

    @Override
    public String getLabel() {
        return label;
    }

    public static List<ExcelImportStatusEnum> getEnumValues() {
        return Arrays.asList(values());
    }

    public static ExcelImportStatusEnum parse(int value) {
        for (ExcelImportStatusEnum item : ExcelImportStatusEnum.values()) {
            if (value == item.getValue()) {
                return item;
            }
        }
        return null;
    }
}